home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / qbsvga.zip / QBSVGA.TXT < prev    next >
Text File  |  1996-04-22  |  13KB  |  251 lines

  1.  
  2.  
  3.  
  4.                         QBSVGA, version 1
  5.  
  6.      "QBSVGA" is a set of subroutines/functions (and an "include file")
  7. that can be used within QB programs to achieve SVGA graphic capability.
  8. Much, but not all, of the standard QB graphic routines are emulated.  To
  9. be specific, the QBSVGA routines work best when the video system is not
  10. just SVGA-capable, but VESA-aware as well.  (I have yet to encounter an
  11. SVGA-equipped system that is not VESA-aware, but I understand they exist.)
  12. There are included stand-alone routines, VS.EXE and VS1.EXE, that you can
  13. use to determine whether or not your system is VESA-aware and what video
  14. modes you have support for.  See VS.TXT for more information concerning
  15. these routines.  Whether or not a VESA bios is present on your SVGA card,
  16. you must not only have hardware support for the video mode you want to
  17. use, it must be supported by your VESA bios as well.  (It's entirely
  18. possible to have support in hardware for a video mode that your bios
  19. cannot itself access.  The routines supplied here do not use direct
  20. hardware access, as opposed to the intrinsic QB graphic routines.)  Further,
  21. for the software to auto-detect a VESA video mode, your VESA bios must
  22. provide the so-called extended information about that mode.  (VS1 will
  23. tell you whether or not this information is available.  If VS1 informs
  24. you that such information is unavailable for any given mode, there is not
  25. necessarily any reason to worry.  If QBSVGA fails to find such information
  26. for any one particular mode, it will simply look for another one.)
  27.  
  28.      Most of the documentation regarding the QBSVGA routines can be found
  29. by reading the comments associated with each subroutine/function in
  30. QBSVGA.BAS.  This file simply makes some general comments and lists the
  31. functionallity provided by QBSVGA.  QBSVGA gives you access to up to 9
  32. different SVGA modes/resolutions:
  33.  
  34.  
  35.     MODE = 14:   640 x  480 x 256
  36.     MODE = 15:   800 x  600 x  16
  37.     MODE = 16:   800 x  600 x 256
  38.     MODE = 17:  1024 x  768 x  16
  39.     MODE = 18:  1024 x  768 x 256
  40.     MODE = 19:  1200 x 1024 x  16
  41.     MODE = 20:  1200 x 1024 x 256
  42.     MODE = 21:  1600 x 1200 x  16
  43.     MODE = 22:  1600 x 1200 x 256
  44.     MODE = 23:   132 x   25 x  16 (text)
  45.     MODE = 24:   132 x   43 x  16 (text)
  46.     MODE = 25:   132 x   50 x  16 (text)
  47.  
  48.  
  49. The mode integers listed above are the "QB-type" integers that you would
  50. input to QBSVGA's analog of QB's screen statement.  They are not necessarily
  51. the actual hex numbers that your bios references (i.e., the video mode
  52. specifiers that QBSVGA, via its subroutine FINDVESA, attempts to auto-
  53. detect).  Except for 0, and assuming that auto-detection works, if you
  54. try to use a QB-mode not specified above, you'll get an 800 x 600 x 16
  55. mode (if support for it can be found).  (Using a mode of 0 produces the
  56. same effect as QB's SCREEN 0 statement.)
  57.  
  58.  
  59.  
  60.      The general method of using QBSVGA is to put the contents of
  61. REGTYPE.INC at the top of your program, write your program, calling any
  62. and whichever of the QBSVGA routines you need, and then put the contents of
  63. QBSVGA.BAS at the bottom of your program.  When you go to link your
  64. compiled program, be sure and use the auxiliary library QB.LIB in addition
  65. to whatever libraries you normally link with.
  66.  
  67.      The usage syntax of the routines is similar to that with the
  68. corresponding internal QB routines.  The QBSVGA routine names are prefixed
  69. with a "B" (for "bios") to distinguish them from their intrinsic QB
  70. analogs.  One difference between the intrinsic and QBSVGA routines is that
  71. you must not leave out parameters unimportant to you in the calls to the
  72. QBSVGA routines.  Another difference is that, except for function BPOINT,
  73. these routines must be accessed via QB's CALL statement.  You can put
  74. DECLARE statements at the top of your program if you wish to avoid this
  75. detail, but there is still the matter of enclosing the arguments/parameters
  76. in parentheses.  Except for subroutine BCOLOR, in addition to the normal
  77. call list parameters, each subroutine/function must be called/invoked with
  78. ", INREGS, OUTREGS" as the last two parameters in the call list.  These
  79. are the CPU register variables.  They contain the data to be stored in the
  80. CPU registers when an interrupt is called and the data output to the
  81. registers when the interrupt call is finished, respectively.  INREGS and
  82. OUTREGS are the only parameters passed to the QBSVGA routines that are
  83. not single precision (real) variables--except for the character string
  84. input to BLINE to tell it what type of object to draw and the string input
  85. to BPRINT.  (An example MAIN routine, SIM.BAS, is included to show the
  86. basic usage of the routines.)
  87.  
  88.      The rest of this file gives a basic description of the different
  89. routines supplied in QBSVGA.BAS.
  90.  
  91.  
  92. SUB BSCREEN:  analog of QB's SCREEN statement
  93.               (QB's SCREEN function is not emulated here.  BSCREEN will
  94.               not change the video mode if the screen is already in the
  95.               mode you're requesting.  In this situation, BSCREEN serves
  96.               merely to change active and displayed video pages.
  97.               Exceptions to this are when your inputting a video mode of 0
  98.               to BSCREEN, to achieve the same effect as QB's SCREEN 0
  99.               statement, or when auto-mode detection failed and you get
  100.               prompted for the bios video mode to use--see below.  BSCREEN
  101.               should be called before any of the other routines--and then
  102.               again with a QB-type mode of 0 when you're all done.)
  103.  
  104. SUB BPSET:  analog of QB's PSET statement
  105.  
  106. SUB BLINE:  analog of QB's LINE statement
  107.             (QB's style option is not supported.)
  108.  
  109. SUB BCIRCLE:  analog of QB's CIRCLE statement
  110.  
  111. SUB BCLS:  analog of QB's CLS 0 and statements
  112.            (CLS 2 is not supported.)
  113.  
  114.  
  115.  
  116. SUB BCOLOR:  analog of QB's COLOR statement
  117.              (There are no interrupt calls within BCOLOR; do not pass the
  118.              register variables to it.)
  119.  
  120. SUB BLOCATE:  analog of QB's LOCATE statement
  121.  
  122. SUB BPRINT:  analog of QB's PRINT statement
  123.              (See QBSVGA.BAS for discussion of differences in how this
  124.              routine formats output.)
  125.  
  126. FUNCTION BPOINT%:  analog of QB's POINT function
  127.                    (Note that BPOINT is a 2-byte INTEGER.)
  128.  
  129. SUB BVIEW:  analog of QB's graphics VIEW statement
  130.             (Although BVIEW itself does not make bios calls, you still
  131.             need to pass the register variables to it so it can use
  132.             subroutine BLINE to handle the color and border options.)
  133.  
  134. SUB BPAINT:  a not necessarily exact analog of QB's PAINT statement
  135.              (You should be able to use this subroutine to achieve the
  136.              same results that PAINT would give if it applied to SVGA
  137.              video modes.  However, especially when painting the exterior
  138.              of objects, you may need to make multiple calls to BPAINT
  139.              with different (x,y) inputs.)  Also, painting only occurs in
  140.              regions in which the pixel color is the same as the
  141.              background.  This background color is either 0 or it is the
  142.              color of whatever the viewport (if active) was filled with.
  143.  
  144.  
  145.      Other than BSCREEN to set the video mode and various defaults, you
  146. should not call any of these routines except BCOLOR, BCLS, BLOCATE, and
  147. BPRINT *unless* you are in a graphics mode (QB-type modes 14 - 22).  (And
  148. to reiterate, don't call ANY of these routines without calling BSCREEN
  149. first!)
  150.  
  151.      There are two other routines that you do not necessarily need to be
  152. concerned with, but at least one of which is worth discussing--especially
  153. if your SVGA isn't a VESA SVGA.  Subroutine FINDVESA inputs a QB-type
  154. mode integer (see above) and first attempts to determine the presence of
  155. a VESA bios.  If it succeeds, it then tries to find a VESA video mode
  156. supported in bios by your video card that gives the resolution and colors
  157. associated with the QB-type mode.  (If it finds one with the right
  158. resolution but can only find such a mode with *more* than the number of
  159. desired colors, the mode is accepted.)  Note that this automatic mode
  160. detection only applies to your video card.  FINDVESA cannot determine
  161. whether or not your monitor has the desired capability.  If FINDVESA
  162. determines that you don't have a VESA system or if, for whatever reason,
  163. it cannot determine what bios mode gives you the resolution you want, it
  164. will cause BSCREEN to prompt you for the bios mode integer (hexadecimal)
  165. that gives you your resolution.  If you know that your system supports the
  166. mode you're requesting, input the hex number that your bios recognizes for
  167. that mode.  If you don't know what to input here, just press ENTER and the
  168. program will STOP.  (This prompt for input somewhat interferes with using
  169. multiple calls to BSCREEN (which calls FINDVESA) to change video modes or
  170.  
  171.  
  172.  
  173. active/displayed pages repeatedly.)  If by chance your graphics calls don't
  174. really need as high resolution as the one for which FINDVESA couldn't find,
  175. you can input the bios mode integer for a lesser mode if you know it.  The
  176. functionallity of BSCREEN and FINDVESA is incorporated in another included
  177. stand-alone routine, FINDMODE.  This program may be of more direct use
  178. in regard to QBSVGA than VS or VS1.  Run FINDMODE from the DOS command-line
  179. with your desired QB-type mode integer specified as an argument and
  180. FINDMODE will either tell you what VESA mode it found that corresponds to
  181. your QB-type mode or it will tell you that it couldn't find such a mode.
  182. This is the same behavior you can expect when you use QBSVGA with your
  183. QB-type mode.
  184.  
  185.     FINDVESA uses the function BIN$ to input a LONG integer (4 bytes) and
  186. convert it to a binary number (represented by the text string BIN$).  You
  187. don't need to worry about this function unless you have some wish to use
  188. it yourself.
  189.  
  190.      There are a few caveats.  First, there are a few Basic variables that
  191. QBSVGA uses that your program must not use (unless of course you're
  192. intentionally doing so as a "backdoor" method of by-passing some of QBSVGA's
  193. simpler routines).  These variables are:
  194.  
  195. ACPAGE  (active video page)
  196. DEFLTC  (default color)
  197. VESSUP  (0 if VESA is supported/detected, 1 otherwise)
  198. HMAX    (zero-based horizontal screen resolution)
  199. VMAX    (zero-based vertical screen resolution)
  200. VXL     (x-coordinate of upper left viewport corner)
  201. VYL     (y-coordinate of upper left viewport corner)
  202. VXR     (x-coordinate of lower right viewport corner)
  203. VYR     (y-coordinate of lower right viewport corner)
  204. VCOL    (Color with which viewport was last filled)
  205. VBORD   (Color with which viewport border was last drawn)
  206.  
  207. (Originally, I circumvented this inconvenience by storing global data in
  208. the "user communication area" at memory location 0:4F0.  However, that was
  209. not without its own dangers--there's no guarantee that some program that
  210. your program SHELLs to DOS, for example, won't overwrite that data.)
  211. Second, although I certainly don't mean to scare you away from using QBSVGA,
  212. I must insist that you use it and the included utilities AT YOUR OWN RISK.
  213. You may want to be careful about using video modes you don't have support
  214. for.  If you are not manually inputting bios video mode data to BSCREEN's
  215. prompt for it, QBSVGA will not make any attempt to put your video adapter
  216. into any mode for which it cannot confirm support.  One problem is that it
  217. is your video card that video support is confirmed for.  If your video card
  218. has more capabilities than your monitor, QBSVGA cannot detect that.  In
  219. particular, you may want to be careful using these routines if you have a
  220. color-capable video card (I've not actually heard of a monochrome SVGA card)
  221. but a monochrome monitor.  (You may especially want to avoid using color
  222. attributes other than 7 in that situation.)
  223.  
  224.  
  225.  
  226.      QBSVGA has no particular hardware requirements, other than that an
  227. SVGA card/monitor be present.  (It may be faster on a 386/486/586 than a
  228. 286, for example, but it should still run on the 286.  Incidentally,
  229. because of the use of bios instead of direct hardware access, QBSVGA is
  230. slower than the intrinsic QB functions.)  The most substantial requirements
  231. are that your operating system be at least compatible with standard PC/MS-
  232. DOS and your computer be IBM compatible.  (And I can't guarantee results
  233. on computers with "nonstandard" bioses or SVGA cards/monitors--not that I
  234. can guarantee them anywhere else either.)  And, although I'm not necessarily
  235. relinquishing copyright or the desire for credit of authorship, I don't have
  236. any particular rules concerning what you do with this software, except for
  237. perhaps selling it.  (I didn't charge YOU for it, did I?)  (But if not
  238. sending me money is keeping you awake nights, by all means, send me some and
  239. get some sleep!)  (Distributing it with software that you've developed and
  240. are selling would be okay--it would be flattering.  I just don't think the
  241. the presence of my software should influence your sales price.)
  242.  
  243.  
  244.  
  245. Glenn Stumpff
  246.  
  247. 4960 Egret Ct.
  248. Dayton, Ohio  45424
  249.  
  250. CIS:  73137,3537
  251.